<template>
    <view>

    </view>
</template>

<script lang="ts" setup>

import { computed, ref } from 'vue';

interface Props {
    confirmText?: string;
    cancelText?: string;
    confirmLoading?: boolean;
    mask?: boolean;
    maskClosable?: boolean;
    maskStyle?: object;
    duration?: number;
    // 标题
    title?: string;
    // 数据 [{name:xxx,value:xxx}]
    list: any;
    // 是否可选
    selected?: boolean;
    // 是否选中
    isChecked?: boolean;
    shadow?: boolean;
}

// Props 赋予初始值
const props = withDefaults(defineProps<Props>(), {
    confirmLoading: false,
    list: [],
    shadow: true,
})


const _class = computed(() => {
    if (props.selected) {
        return checked.value ? 'selected' : 'select'
    }
    return ''
})

const checked = computed(() => {
    return props.isChecked
})

const emits = defineEmits(['click', 'checkedChange'])

function _onClick(e) {
    emits('click', e);

}


let showModal = ref(false);
let showLoading = ref(false);

const info = () => {
};

const success = () => {
};

const warning = () => {
};

const error = () => {
};

const open = () => {
    showModal.value = true;
};

const close = () => {
    showModal.value = false;
};

const closeLoading = () => {
    showLoading.value = false;
};


defineExpose({
    info,
    success,
    warning,
    error,
    open,
    close,
    closeLoading
});


</script>

<style lang="scss" scoped></style>
